@import '~components/constants.scss';

.main_view {
  flex: 1;
  background: $white;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  position: relative;

  .no_channel_text {
    color: #000;
    position: absolute;
    margin: auto;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    height: 40px;
    width: 300px;
    text-align: center;
    font-size: 16px;
    opacity: 0.5;
  }

  .header {
    padding: 13px 16px;
    display: flex;
    border-bottom: 1px solid $grey_light;
    flex-direction: column;
    justify-content: center;

    .inline_header {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
    }
    .channel_description {
      font-size: 12px;
      width: 100%;
      color: var(--grey-dark);
    }

    .app-icon {
      height: 28px;
      display: inline-flex;
      align-items: center;
      vertical-align: top;
      margin-right: 5px;
      color: $grey_dark;
      font-size: 20px;
      margin-left: -6px;
    }

    .tabs {
      flex: 1;
    }

    .right {
      .input_icon {
        margin-top: 2px;
      }
    }
  }

  .channel_header {
    display: flex;
    flex-direction: row;
    .search {
      margin-right: 32;
      margin-top: 13;
      margin-bottom: 12;
      height: 40px;
      width: 193px;
      font-size: 16px;
      position: absolute;
      right: 0;
      top: 0;
    }

    .search_icon {
      height: 40px;
      width: 40px;
      font-size: 16px;
      position: absolute;
      right: 110;
      top: 10;
    }

    .title {
      font-size: 14px;
      font-weight: 500;
      line-height: 28px;
      display: inline-block;
      margin-right: 24px;
      margin-bottom: 0px;
      margin-top: 4px;
      color: var(--black);

      .emoji-container {
        margin-right: 4px;
        .emojione {
          margin-top: -6px;
        }
      }

      &.direct_message {
        line-height: 28px;
        height: 28px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        width: 100%;
      }

      .app-plug-icon {
        margin-right: 25px;
        vertical-align: middle;
        margin-top: -5px;
        margin-left: -3px;
        opacity: 0.5;
      }

      .user_image {
        background-color: $grey_light;
        width: 26px;
        height: 26px;
        border-radius: var(--default-border-radius-large);
        position: relative;
        background-color: #dddddd;
        background-size: cover;
        background-position: center;
        vertical-align: bottom;
        display: inline-block;
        border: 1px solid #fff;
        margin-right: 0px;
        vertical-align: top;
        margin-right: 4px;

        &:not(:first-child) {
          margin-left: -16px;
        }
      }

      img.emojione {
        width: 20px;
      }

      .lock_icon {
        font-size: 15px !important;
        margin-bottom: -2px;
        margin-left: 2px;
      }
    }
  }

  .tabs {
    padding: 4px 0;

    .tab_add_menu {
      display: inline-block;
      height: 28px;
      vertical-align: top;
      padding-top: 3px;
      box-sizing: border-box;
    }
    .tab_add {
      width: 22px;
      height: 22px;
      line-height: 20px;
      padding-top: 2px;
      vertical-align: middle;
      opacity: 0.8;
      .m-icon-small {
        font-size: 18px !important;
      }
    }
    .tab_group {
      display: inline-block;
      margin-right: 8px;
      border-radius: var(--default-border-radius);

      &:hover {
        background: $grey_background;
      }
      .tab {
        margin-right: 0px;
        border-radius: 0px;
        padding-right: 8px;
        &:first-child {
          border-radius: $base_border_radius 0 0 $base_border_radius;
        }
        &:last-child {
          border-radius: 0 $base_border_radius $base_border_radius 0;
        }
        &:hover {
          background: $primary_background;
          color: $primary;
        }
        &:first-child:last-child {
          border-radius: $base_border_radius;
        }
      }
    }
    .tab {
      font-size: 14px;
      display: inline-flex;
      padding: 0 4px;
      border-radius: var(--default-border-radius);
      height: 28px;
      box-sizing: border-box;
      line-height: 28px;
      margin-right: 5px;
      color: var(--grey-dark);
      font-weight: 500;
      margin-right: 8px;
      cursor: pointer;

      .icon {
        display: flex;
        align-items: center;
        margin-right: 4px;
        font-size: 16px;
      }

      &:hover {
        background: $primary_background;
        color: $primary;
      }

      &.is_selected {
        background: $primary_background;
        color: $primary;
      }

      .options {
        display: inline-block;
        display: flex;
        align-items: center;
        margin-left: 6px;
        &:hover {
          opacity: 0.8;
        }
      }
    }

    padding-bottom: 5px;
  }

  .app_views {
    flex: 1;
    min-width: 0;
    display: flex;
    height: 100%;
    overflow: hidden;

    .app_main {
      position: relative;
      flex: 1;
      min-width: 0;
      display: flex;
    }
    .app_side {
      position: relative;
      width: 46%;
      border-left: 1px solid var(--grey-background);
      display: flex;
      flex-direction: column;

      @media screen and (max-width: 1000px) {
        &:after {
          content: '';
          position: absolute;
          z-index: 99;
          background: rgba(0, 0, 0, 0.3);
          left: 0px;
          top: 0px;
          height: 100vh;
          width: 100vw;
          margin-left: -100vw;
        }
        position: absolute;
        right: 0px;
        height: 100vh;
        top: 0;
        background: #fff;
        width: 70vw;
        box-shadow: 0 0 64px rgba(0, 0, 0, 0.3);
        z-index: 10;
      }
      @media screen and (max-width: 640px) {
        width: 100vw;
      }

      .side_header {
        height: 40px;
        background: var(--grey-background);
        font-size: 13px;
        font-weight: 500;
        color: var(--black-alpha-2);
        padding: 8px;
        padding-left: 16px;
        line-height: 24px;
        box-sizing: border-box;
        overflow: hidden;
        display: flex;

        & > span {
          text-overflow: ellipsis;
          overflow: hidden;
          white-space: nowrap;
          min-width: 0;
          flex: 1;
        }

        .close {
          cursor: pointer;
          right: 8px;
          color: var(--black-alpha-1);
          &:hover {
            color: var(--black);
          }
        }
      }

      .app_side_content {
        flex: 1;
        display: flex;
        position: relative;
        overflow: hidden;
      }
    }

    .app {
      flex: 1;
      position: relative;
      display: flex;

      .app_loader {
        position: absolute;
        margin: auto;
        width: 50px;
        height: 50px;
        right: 0px;
        bottom: 0px;
        top: 0px;
        left: 0px;
      }
    }
  }
}

.appPage.public {
  background-color: $primary;
  flex-direction: column;

  .main_view {
    border-radius: var(--default-border-radius-large) var(--default-border-radius-large) 0 0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  }

  .public_header {
    width: 100vw;
    height: 64px;
    display: flex;
    flex-direction: row;

    .left {
      padding: 16px;
      padding-left: 24px;
      display: flex;
      flex-direction: row;

      & > .companyName {
        margin-left: 16px;
        line-height: 32px;
        color: #fff;
        font-weight: 600;
      }
    }

    .right {
      flex: 1;
      text-align: right;
      font-size: 12px;
      padding: 16px;
      padding-right: 24px;
      line-height: 32px;

      a {
        color: #fff;
        &:hover {
          opacity: 0.8;
        }
      }
    }
  }
}

.loading_render {
  .main_view .no_channel_text,
  .main_view .app {
    opacity: 0;
  }
}
